home *** CD-ROM | disk | FTP | other *** search
/ Just Call Me Internet / Just Call Me Internet.iso / com / internet / sting / time / t_random / t_random.doc < prev    next >
Text File  |  1997-08-09  |  2KB  |  43 lines

  1. ;----------------------------------------------------------------------------
  2. ;File name:    T_RANDOM.DOC            Revision date:    1997.08.10
  3. ;Creator:    Ulf Ronald Andersson        Creation date:    1997.08.01
  4. ;(c)1997 by:    Ulf Ronald Andersson        All rights reserved
  5. ;Feedback to:    dlanor@oden.se            Released as FREEWARE
  6. ;----------------------------------------------------------------------------
  7. ;--- !!! ---  Please read the full text below at least once.  --- !!! ---
  8. ;This will help you avoid some simple but otherwise inescapable problems.
  9. ;----------------------------------------------------------------------------
  10.  
  11. T_RANDOM is a simple program that generates a random number and uses that
  12. as if it were a network time specification to set the realtime clock.
  13. It serves no other purpose than this, and exists only to let me test my
  14. time server software thoroughly.  I have included it in this release mainly
  15. as part of my policy of keeping everything available to the public.
  16.  
  17. This program will run as ACC, APP, GTP, PRG, TOS, or TTP program, under all
  18. known system environments with any Atari TOS compatibility.
  19.  
  20. This program has no user interface, and will simply randomize the system time
  21. setting each time it is invoked.
  22.  
  23. Programmers may be interested in studying the pseudorandom generator which
  24. is formed by subroutines 'rand_long', 'rand_31_long' and 'rand_31_word'.
  25. This is a proper 31-bit pseudorandom generator going through all 2^31-1
  26. possible combinations (zero excluded).  I have modified the pure shift
  27. register simulation so as to be able to generate 16 bits per go, which
  28. makes it one of the fastest generators around.  Also, although the shift
  29. randomicity is based on 31 bits, the output data is 32 bits wide, all of
  30. which are separate bits of the random bit stream.
  31.  
  32. Entry points 'rand_31_long' and 'rand_31_word' will transform a 32 bit seed
  33. number in d0 by 32 and 16 normal generator steps each.  Thus the former gives
  34. an entirely new longword for each call, while the latter gives a short word.
  35.  
  36. I will probably add functions based on these routines to my development
  37. libraries later, considering the very low quality and hopeless inefficiency
  38. of the Random function in XBIOS.
  39.  
  40. ;----------------------------------------------------------------------------
  41. ;End of file:    T_RANDOM.DOC
  42. ;----------------------------------------------------------------------------
  43.